package com.nix.web.databases.pojo.user;

import com.nix.web.databases.pojo.BasePojo;
import com.nix.web.databases.pojo.word.Word;
import com.nix.web.databases.pojo.word.WordError;

import java.util.List;

/**
 * @author zhangpei
 * @Email zhangpe0312@qq.com
 * @day 2017/11/1 23:19
 * @Use 用户基础信息
 */
public class User extends BasePojo {
    private String name;
    private String password;
    private Integer enable;
    /**
     * 一个用户有一个信息表和角色
     */
    private Info info;
    private Role role;

    /**
     *一个用户有多个单词绑定
     */
    private List<Word> words;
    /**
     * 该用户标注的单词错误
     */
    private List<WordError> wordErrors;

    public List<WordError> getWordErrors() {
        return wordErrors;
    }

    public void setWordErrors(List<WordError> wordErrors) {
        this.wordErrors = wordErrors;
    }

    public List<Word> getWords() {
        return words;
    }

    public void setWords(List<Word> words) {
        this.words = words;
    }

    public String getName() { return name; }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getEnable() { return enable; }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    public Info getInfo() {
        return info;
    }

    public void setInfo(Info info) {
        this.info = info;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + getId() + '\'' +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", enable=" + enable +
                ", info=" + info +
                ", role=" + (role == null ? null : role.toString()) +
                ", words=" + words +
                ", wordErrors=" + wordErrors +
                '}';
    }
}
